package net.hound.site.video;

import java.io.IOException;
import java.util.HashMap;
import java.util.Map;

import net.cl.utils.FileUtil;
import net.cl.utils.HttpUtil;

public class Youtube {

	public Map<String, String> getAllFmtVideo(String s) {
		String[] tmp = s.split(",");
		Map<String, String> map = new HashMap<String, String>();
		if (tmp.length > 0) {
			for (String t : tmp) {
				String[] tmp1 = t.split("\\|");
				map.put(tmp1[0], tmp1[1]);
			}
		}
		return map;
	}

	public static void main(String[] args) {
		try {
			String s = FileUtil.read("D:/get_video_info");
			String s1 = HttpUtil.getParameter(s, "fmt_url_map");
			System.out.println(HttpUtil.getParameter(s, "title"));
			Youtube youtube = new Youtube();
			System.out.println(youtube.getAllFmtVideo(s1).get("22"));
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
}
